-- LuaDebug
-- Create by weism
-- lua代码调试输入框

LuaDebug = class("LuaDebug", function() 
    return cc.Layer:create();
end);

function LuaDebug.create()
    return LuaDebug.new();
end    

-- 构造函数
function LuaDebug:ctor(msg, skipable)
    local node = cc.CSLoader:createNode("layout/dialog/LuaDebug.csb");
    self:addChild(node);  

    local button = node:getChildByName("button");
    local input = node:getChildByName("input");
    button:addTouchEventListener(function(sender, eventType)
        if eventType == ccui.TouchEventType.ended then  
            local f = loadstring(input:getString());
            f();
        end
    end);
end

return LuaDebug;